package com.decapre.springbootdemo.service;

import com.decapre.springbootdemo.entity.Office;
import com.decapre.springbootdemo.repository.OfficeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class OfficeServiceImpl implements OfficeService {

    private OfficeRepository officeRepository;

    @Autowired
    public OfficeServiceImpl(OfficeRepository officeRepository){
        this.officeRepository = officeRepository;
    }
    @Override
    public List<Office> getAllOffice() {
        return officeRepository.selectAllOffice();
    }

    @Override
    public Office getOfficeById(int officeId) {
        return  officeRepository.selectOfficeById(officeId);
    }
}
